#ifndef CALLBACK_HPP
#define CALLBACK_HPP

/*
class CallbackBypassCompiler{};

template <class T>
class Callback
{
public:
	typedef void(CallbackBypassCompiler::*fptr)(void*, ...);
	Callback(void(T::*func)(void*, ...), void *classInstance) : mClassInstance((CallbackBypassCompiler*)classInstance)
	{
		assert(classInstance);
		mFunc = *(void**)&func;
	}

	Callback(void *func, void *classInstance = nullptr) : mFunc(func), mClassInstance((CallbackBypassCompiler*)classInstance){}

	inline void operator()(...)
	{
		// If the function is a class member function
		if(mClassInstance)
		{
			fptr pFunc = *(fptr*)&mFunc;
			(mClassInstance->*pFunc)(mClassInstance, ...);
		}
		else
		{
			typedef void(*cfptr)(...);
			cfptr pFunc = (cfptr)mFunc;
			pFunc(...);
		}
	}
private:
	void *mFunc;
	CallbackBypassCompiler *mClassInstance;
};
*/

#endif